﻿using System.Collections.Generic;
using System.Linq;
using KLS.PPDS.Core.Entity;
using KLS.PPDS.Data.Database.Repository.RepositoryInterfaces;

namespace KLS.PPDS.Data.Database.Repository.EntityRepository
{
    public class ArticleContentRepository : LinqRepository<ArticleContent>, IArticleContentRepository
    {


        public List<ArticleContent> GetAllArticleContent()
        {
            return FindAll().ToList();

        }

        public ArticleContent GetArticleContentById(int articleContentId)
        {
            return FindOne(articleContentId);

        }

        public List<ArticleContent> GetArticleContentByArticleId(int articleId)
        {

            return FindAll().Where(x => x.ArticleId.Equals(articleId)).OrderBy(c=>c.Id).ToList();
        }


    }
}
